package com.mohunhun.mapper;

import com.mohunhun.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {

    /**
     * 根据id查询部门信息
     * @param id 部门id
     * @return 部门信息
     */
    @Select("select id,name,create_time, update_time from dept where id = #{id}")
    Dept selectDeptById(Integer id);

    /**
     * 查询所有部门信息
     * @return 部门信息
     */
    @Select("select id,name,create_time, update_time from dept")
     List<Dept> finAll();


    /**
     * 根据 id删除部门信息
     */
    @Delete("delete from dept where id = #{id}")
     void deleteDeptById(Integer id);
}
